package cn.xu.tool.big.a;

import cn.xu.tool.big.a.compments.CombinedReportCp;
import cn.xu.tool.big.a.compments.KlineCp;
import cn.xu.tool.big.a.compments.transaction.TransactionCp;
import cn.xu.tool.big.a.compments.transaction.TransactionCp2;
import cn.xu.tool.big.a.dto.KLine;
import cn.xu.tool.big.a.dto.TotalReturn;
import cn.xu.tool.big.a.dto.TradeRecord;

import java.util.List;

/**
 * 类名: StartMain
 * 描述: TODO
 * 作者: ClarkXu clark2021@qq.com
 * 日期: 2025/7/8
 */
public class StartMain {

    public static void main(String[] args) throws Exception {
        String startDate = "20240101";
        String endDate = "20250711";
        String stockCode = "cn_513180";
        double initialCapital = 100000; // 初始资金10万
        double commissionRate = 0.0001354; // 佣金率1.354/万
        TotalReturn totalReturn = new TotalReturn();

        List<KLine> kLines = KlineCp.readKline(stockCode, startDate, endDate);
        List<TradeRecord> tradeRecords = TransactionCp2.doTransactionBt(kLines, stockCode, startDate, endDate, initialCapital, commissionRate, totalReturn);
        CombinedReportCp.createCombinedReport(tradeRecords, totalReturn, kLines, stockCode, startDate, endDate);
    }

}
